package Interator;

import org.junit.Test;

public class ApiTest {
    @Test
    public void test(){
        String[] names = {"软件工程专业","大数据专业","人工智能专业","数字媒体艺术专业"};
        NameRepository nameRepository = new NameRepository(names);

        System.out.println("软件学院的专业：");
        for(Iterator iter = (Iterator) nameRepository.getIterator(); iter.hasNext();){
            String name = (String) iter.next();
            System.out.println("         " + name);
        }
    }

    @Test
    public void test1(){
        String[] names = {"软件工程专业","大数据专业","人工智能专业","数字媒体艺术专业"};
        for (String name : names){
            System.out.println(name);
        }

    }
    @Test
    public void test2(){
        String[] names = {"软件工程专业","大数据专业","人工智能专业","数字媒体艺术专业"};
        for(int i = 0; i < names.length;i++){
            System.out.println(names[i]);
        }
    }
}
